Skip to content

Focus contamination warn on PLC potential#62

Merged
dacharyc merged 1 commit intomainfrom
reduce-contamination-warnings
Apr 10, 2026
Merged

Focus contamination warn on PLC potential#62
dacharyc merged 1 commit intomainfrom
reduce-contamination-warnings

Conversation

@dacharyc
Copy link
Copy Markdown
Member

@dacharyc dacharyc commented Apr 10, 2026

What this PR does

As reported in #60 , we're currently warning on contamination even for cases where there are only auxiliary languages. This is unnecessarily noisy; the contamination check is intended to flag application programming languages for PLC risk. There is no research to support similar concerns exist for config languages or shell.

With these changes, the contamination check should now only fire when multiple application languages are detected.

How to test

New tests in:

  • contamination/contamination_test.go
  • orchestrate/orchestrate_test.go

And a new test fixture that contains only auxiliary languages to confirm correct behavior.

Checklist

  • Tests pass locally (go test -race ./... -count=1)
  • Lint passes locally (golangci-lint run)
  • New functionality includes tests
  • Breaking changes are noted above (if any)

@dacharyc dacharyc merged commit 935f2bf into main Apr 10, 2026
2 checks passed
@dacharyc dacharyc deleted the reduce-contamination-warnings branch April 10, 2026 22:45
Copy link
Copy Markdown
Member

@masukomi masukomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some quickie bugs (duplicated languages in multiple places) and suggest the addition of a couple languages to the aux languages

func TestAnalyze_AuxiliaryOnlyMismatches(t *testing.T) {
// python + bash + yaml: auxiliary mismatches should score low
// python + bash + yaml: auxiliary categories are not mismatches
languages := []string{"python", "python", "bash", "yaml"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts re this:

  1. "python" is listed twice
  2. According to our skill corpus sh and shell appear as the codefenced language in 649 of the original skills. So, < 1% but…

func TestAnalyze_MixedMismatches(t *testing.T) {
// java + config + shell + markup: 3 auxiliary mismatches
// java + config + shell + markup: all auxiliary, no app↔app mismatch
languages := []string{"java", "java", "yaml", "bash", "html"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"java", "java"


func TestAnalyze_AppAndAuxMixed(t *testing.T) {
// python + javascript + bash + yaml: only javascript is an app mismatch
languages := []string{"python", "python", "javascript", "bash", "yaml"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"python", "python"

func TestAnalyze_AuxPrimaryWithAppMismatch(t *testing.T) {
// bash appears most often (overall primary is shell/auxiliary),
// but javascript and python are both present → app↔app mismatch
languages := []string{"bash", "bash", "bash", "javascript", "python"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bash", "bash", "bash",


func TestAnalyze_PurelyAuxiliary(t *testing.T) {
// Only auxiliary languages — no application languages at all
languages := []string{"bash", "yaml", "json", "sh"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sh is here but not shell and neither is present above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants